package com.vxb.testmvp.test_retrofit;

import android.content.Intent;
import android.support.v4.widget.TextViewCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.vxb.testmvp.R;
import com.vxb.testmvp.util.SPUtils;

import butterknife.Bind;
import butterknife.ButterKnife;

public class RetrofitMainActivity extends AppCompatActivity {


    @Bind(R.id.tv_token)
    TextView tv_token;
    @Bind(R.id.recyclerview)
    RecyclerView recyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_retrofit_main);

        ButterKnife.bind(this);

        String token = (String) SPUtils.get("token", "token 获取失败", this);

        tv_token.setText(getString(R.string.token, token));

    }


    protected void launch(Class<?> cls) {
        Intent intent = new Intent(this, cls);
        startActivity(intent);
    }

    public <T extends View> T mfindViewById(int resId) {
        return (T) findViewById(resId);
    }

}
